]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
notificationDaemon: Focus the new window before destroying the notification
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 7 Oct 2013 20:11:18 +0000 (16:11 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 8 Oct 2013 17:05:34 +0000 (13:05 -0400)
Destroying the notification will make the key focus be reset to NULL, which
means that gnome-shell will try to focus the MRU window, thinking the user is
done interacting and wants to go back to whatever they were doing.

Unfortunately, since we focus two windows at the same time, they will have
the same timestamp, meaning that the window that actually gets focused will
be a race as to whoever responds to their WM_TAKE_FOCUS event last.

If we explicitly set the focus beforehand, then gnome-shell will believe it
got key focus taken away from it, and won't try to focus the MRU when the
key focus drops to NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=703265

js/ui/notificationDaemon.js

index de4271131fad5f6ed77bce8d119b9195031cca45..63f03af117f9e24877eb4615c6c020f3c06c3aea 100644 (file)
@@ -779,8 +779,8 @@ const Source = new Lang.Class({
     },
 
     open: function(notification) {
-        this.destroyNonResidentNotifications();
         this.openApp();
+        this.destroyNonResidentNotifications();
     },
 
     _lastNotificationRemoved: function() {